//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Workflow
//  File name:	IWorkflowService.cs
//  Developer:	Solomatov Igor
//  Created:	16.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System.Collections.Generic;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;

namespace Smart.Workflow
{
	/// <summary>
	/// Workflow customization service
	/// </summary>
	public interface IWorkflowService
	{
		/// <summary>
		/// Initialize service
		/// </summary>
		void Init(SPWorkflowActivationProperties WorkflowProperties, ActivityProperties activityProperties);

		/// <summary>
		/// Workflow properties
		/// </summary>
		SPWorkflowActivationProperties WorkflowProperties { get; set; }

		/// <summary>
		/// Activity properties
		/// </summary>
		ActivityProperties ActivityProperties { get; set; }

		/// <summary>
		/// Returns task ContentTypeId by <paramref name="taskType"/>
		/// </summary>
		string GetTaskContentTypeId(TaskType taskType);

		/// <summary>
		/// Returns message template
		/// </summary>
		string GetHistoryMessageTemplate(string eventType);

		/// <summary>
		/// Returns notification template name
		/// </summary>
		string GetNotificationTemplateName(string eventType);

		/// <summary>
		/// Sends notification message to Assignee email
		/// </summary>
		void SendNotification(string eventType, SPListItem taskItem, SPWorkflowTaskProperties properties, Dictionary<string, object> values);

		/// <summary>
		/// Sends notification message to <paramref name="emails"/>
		/// </summary>
		void SendNotification(string eventType, string emails, SPListItem taskItem, SPWorkflowTaskProperties properties, Dictionary<string, object> values);

		/// <summary>
		/// Returns values for rules service
		/// </summary>
		void FillRulesValues(Dictionary<string, object> values);

		/// <summary>
		/// Perform action from rules on Workflow
		/// </summary>
		bool PerformAction(string actionName, string[] actionArgs, out bool handled);

		/// <summary>
		/// Execute Workflow rule condition function
		/// </summary>
		bool ExecuteFunction(string functionName, string[] functionArgs, out bool handled);
	}
}